//函数指针给函数传参
#include<stdio.h>

//计算两数中最大值
int max(int x,int y){
	
	int temp;
	if(x > y)
		temp = x;
	else
		temp = y;
	
	return temp;
}
//计算两数中最小值
int min(int x,int y){
	
	int temp;
	if(x < y)
		temp = x;
	else
		temp = y;
	
	return temp;
}
//求两数之和
int add(int x,int y){

	return x + y;
}
//求两数之差
int sub(int x,int y){
	
	return x - y;
}
//求两数之积
int mux(int x,int y){

	return x * y;
}
//求两数之商
int dive(int x,int y){
	
	return x / y;
}

int process(int(*p)(int,int),int x,int y){
	
	int ret;
	ret = (*p)(x,y);
	
	return ret;
}

int main(){
		
	int num;
	num = process(min,10,20);
	printf("num = %d\n",num);	
	
	num = process(mux,10,20);
	printf("num = %d\n",num);	
	
  	return 0;
}